
import http from "@/utils/request"


export const addStu = (data)=> http.post('/students/addstu',{
    ...data,
})

//获取学员信息

export const getStuListApi = (count=10,page=1,classes) => http.get("/students/getstulist",{
    params:{
        count,
        page,
        class:classes,
    }
})

//编辑学员信息

export const editStuApi = (data)=> http.post('/students/updatestu',{
    ...data,
})

//删除学员信息

export const deleteStu = (sId)=>http.get('/students/delstu',{
    params:{
        sId,
    }
})


//搜索学员

export const searchStuApi = (page, key, count) => {
    //短路运算
    count = count || 10;
    key = key || "";
    page = page || 1;
    return http.get("/students/searchstu", {
      params: {
        page,
        count,
        key,
      },
    });
  };
  
 
//获取班级列表

export const getClassesApi = () => http.get("/students/getclasses");